<?php
require_once './classes/Person.php';
class Student extends Person {
    // 继承了Person Student拥有了Person类的所有属性和方法
    public $score; // 公共的 在类的外部不能使用私有属性
    public function __construct($name, $age, $score)
    {
        parent::__construct($name, $age);
        $this->score = $score;
    }

    public function printScore() {
        echo '成绩：' . $this->score . '<br/>';
    }
    public function setScore($score = 0) {
        $this->score = $score;
    }

    public function eat2() {
        $this->eat('beef');
    }

    public function printInfo() {
        parent::printInfo();
        $this->printScore();
    }

}

